package top.v5it.japi.plus.example.jdbc.controller;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * 示例DTO
 *
 * @author zhanpu
 * @date 2022/6/21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TestExampleDTO implements Serializable {

    private static final long serialVersionUID = 1356075427403479014L;

    private Long id;
    @NotBlank(message = "用户名称不能为空")
    private String name;
    private String sex;
    private LocalDate birthday;
    private Resource resource;

    /**
     * 申明需要加解的密敏感信息放在Resource中
     */
    @Data
    public static class Resource {

        /**
         * 手机号
         */
        private String tel;
        /**
         * 身份证号
         */
        private String idNum;
    }
}
